module.exports = {
  nav_name: '用户管理', //生成导航菜单
  module_name: 'user_manager',  //生成路径，与模块名相同
  api: `{
    page: commonPath + "/admin/user/page", // 分页
    detail: commonPath + '/admin/user/get', //详情,
    edit: commonPath + "/admin/user/editUserInfo", //编辑

    getLabel: commonPath + "/admin/label/page", //行业标签
  }`,
  table: {
    nav_name: "用户列表",
    tipsText: "用户管理 >> 用户列表",
    //获取列表页面
    tableData: [
      { title: '序号', name: 'index', type: "normal" },
      { title: '用户昵称', name: 'userName', type: "normal", showObj: "{}" },
      { title: '手机号', name: 'tel', type: "normal", showObj: "{}" },
      { 
        title: '会员身份', 
        name: 'level', 
        type: "opts", 
        showName: "levelShow",
        showObj: `{
          "1": "试用用户",
          "2": "试用会员",
          "3": "会员",
          "4": "理事",
          "5": "副会长",
          "6": "会长",
        }` 
      },
      { title: '所属企业', name: 'companyName', type: "normal", showObj: "{}" },
    ],
    tableOpt: [
      {
        type: "view",
        text: "查看",
        request: false,
        jump: "/user_manager_user_detail"
      },
      {
        type: "modify",
        text: "编辑",
        request: false,
        jump: "/user_manager_add_page"
      },
      // {
      //   type: "changeState",
      //   text: "加入黑名单",
      //   request: true,
      //   url: "API.member_manager.changeState",
      //   requestType: 'post',
      //   params: `{id,  state: 2 }`, //必须为文本
      //   methodNameTag: 'Black', //方法衔接拓展名
      // },
      // {
      //   type: "del",
      //   text: "删除",
      //   request: true,
      //   url: "API.member_manager.del",
      //   requestType: 'post',
      // },
      // {
      //   type: "changeState",
      //   text: "启用",
      //   request: true,
      //   url: "API.member_manager.del",
      //   requestType: 'post',
      //   params: `{ state: 1 }`,
      //   methodNameTag: 'Enable', //方法衔接拓展名 用于标志不同方法
      // },
    ],
    search: {
      contentArr: {
        input1: { labelName: '手机号', inputName: 'tel' },
        input2: { labelName: '用户昵称', inputName: 'userName' },
      },
      searchBtn: {
        text: "查询", //链接与table请求接口相同，不做另外配置
      },
      // addBtn: {
      //   //搜索栏具有添加功能按钮时，设置此字段
      //   type: "add",
      //   text: "添加",
      //   request: false,
      //   jump: "/member_manager_add_page"
      // }
    },
  },

  
  //添加页面
  add_page: {
    isGenerate: "false", //false表示不生成页面
    add_page_name: "add_page",
    tipsText: "用户管理 >> 用户",
    formData: {
      input1: {
        labelName: '用户昵称',
        inputName: 'userName',
        isNeed: 'true',
      },
      input2: {
        labelName: '手机号',
        inputName: 'tel',
        isNeed: 'true',
      },
      input3: {
        labelName: '所属企业',
        inputName: 'companyName',
        isNeed: 'true',
      },
      input4: {
        labelName: '公司职务',
        inputName: 'companyDuty',
        isNeed: 'true',
      }, 
      select5: {
        labelName: '身份',
        inputName: 'level',  //输入绑定的变量
        selectOptsName: "levelOpts",
        selectOptsArr: `[
          { value: "1", label: "试用用户"},
          { value: "2", label: "试用会员"},
          { value: "3", label: "会员"},
          { value: "4", label: "理事"},
          { value: "5", label: "副会长"},
          { value: "6", label: "会长"},
        ],`, //暂时在添加页面的枚举要加逗号
        isNeed: 'true',
      },
      chooseSimgleTime66: {
        labelName: '到期时间',
        inputName: 'expirationTime',
        isNeed: 'true',
      },
    },
    addBtn: {
      text: '添加',
      url: "API.user_manager.add"
    }, //
    editBtn: {
      text: '编辑',
      detailUrl: "API.user_manager.detail",
      editUrl: "API.user_manager.edit",
      jump: '/user_manager_table',
      isSplitSearchString: 'true', //拼接查询字符串
    },
    cancelBtn: { text: "取消" }, //
  },

  //详情页面
  detail_page: {
    isGenerate: 'false',
    detail_page_name: "user_detail",
    detail_api: "API.user_manager.detail",
    request_params : `{
      id,
    }`,
    tipsText: "课程管理 >> 课程",
    formData: {
      // titleText: "请填写管理员相关信息",
      item1: {
        labelName: '用户昵称',
        inputName: 'userName',
        type: "normal",
        frontTips: "", //后面的说明
        behindTips: "", //前面的说明
      },
      
      item2: {
        labelName: '手机号码',
        inputName: 'tel',
        frontTips: "", //后面的说明
        behindTips: "", //前面的说明
      },
      item3: {
        labelName: '会员身份',
        inputName: 'level',
        type: "opts",
        frontTips: "", //后面的说明
        behindTips: "", //前面的说明
        optShowName: "levelOpts",
        optShowStr: `{
          "1": "试用用户",
          "2": "试用会员",
          "3": "会员",
          "4": "理事",
          "5": "副会长",
          "6": "会长",
        }`
      },
      item4: {
        labelName: '所属企业',
        inputName: 'companyName',
        frontTips: "", //后面的说明
        behindTips: "", //前面的说明
      },
      // item5: {
      //   labelName: '最近登录时间',
      //   inputName: 'courseContent',
      //   frontTips: "", //后面的说明
      //   behindTips: "", //前面的说明
      // },
    },

    // //额外请求
    // extraRequest: {
    //   dataCode: [ 
    //     "courseTypeOpts"
    //   ],
    //   methodsCode: [
    //     {
    //       explainText: "课程类别获取", //说明
    //       type: "opts",  //表示选项类型格式，value, label
    //       methodName: "getCourseTypeData",
    //       api: "API.course_manager.course_sort_page",
    //       optsName: "courseTypeOpts",
    //       params: `{
    //         "pageIndex": 1,
    //         "pageSize": 100,
    //       }`,
    //       optsConfig: {
    //         label: "typeName",
    //         value: "id"
    //       }
    //     }
    //   ]
    // },

  }
}
